package com.lifeng.controller;

import com.lifeng.common.util.Result;
import com.lifeng.entity.Student;
import com.lifeng.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: lifeng
 * @description:
 **/

@RestController
@RequestMapping("/student")
public class StudentController {
	@Autowired
	private StudentService studentService;
	@GetMapping("/list")
	public Result findAll(){
		List<Student> list = studentService.list();
		return Result.ok().data("students",list);
	}
}
